package com.singlemountain.gcommerce.domain.product;

import com.singlemountain.gcommerce.domain.base.Base;
import com.singlemountain.gcommerce.domain.color.Colord;
import com.singlemountain.gcommerce.domain.colorsizequantity.ColorSizeQuantity;
import com.singlemountain.gcommerce.domain.image.Imaged;
import com.singlemountain.gcommerce.domain.productgroup.ProductGroupd;
import com.singlemountain.gcommerce.domain.size.Sized;
import java.util.HashSet;
import java.util.Set;
import javax.*;
import javax.persistence.*;

import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaActiveRecord
public class Productd extends Base {

    private int weight;

    private int stock;

    private double price;

    @ManyToOne
    private Colord color;

    @ManyToOne
    private Sized sized;

    @ManyToOne
    private ProductGroupd productGroup;

    @JoinColumn
    @OneToMany(cascade = CascadeType.ALL)
    private Set<Imaged> imageSet = new HashSet<Imaged>();

    @Transient
    private Imaged defaultImage;

    @JoinColumn
    @OneToMany(cascade = CascadeType.ALL)
    private Set<ColorSizeQuantity> colorSizeQuantitySet = new HashSet<ColorSizeQuantity>();


}
